package com.wcq.studentbackend.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 班级实体类
 *
 * @author Gemini
 * @since ${.now?date}
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("classes") // 对应数据库中的 'classes' 表
public class Class implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 班级ID, 自增主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 班级名称
     */
    @TableField("class_name")
    private String className;

    /**
     * 班主任
     */
    @TableField("head_teacher")
    private String headTeacher;

    /**
     * 学生人数
     */
    @TableField("student_count")
    private Integer studentCount;

    /**
     * 创建时间
     */
    @TableField("create_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField("update_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm")
    private LocalDateTime updateTime;
} 